package com.ruoyi.zhjd.exp.modules.laboratorydevice.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;


import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

/**
 * @ClassName: LaboratoryDeviceEntity
 * @Description: 实验室设备
 * @author linhuawei
 * @since 2021-05-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_laboratory_device")
@JsonIgnoreProperties({ "deleted" })
public class LaboratoryDeviceEntity {

    /**
     * 设备主键
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 基地编码
     */
    @NotBlank(groups = { AddGroup.class, EditGroup.class }, message = "基地名称不可为空")
    private String baseCode;

    /**
     * 试验室名称
     */
    @NotBlank(groups = { AddGroup.class, EditGroup.class }, message = "试验室名称不可为空")
    @Length(groups = { AddGroup.class, EditGroup.class }, max = 20, message = "试验室名称不可超过{max}")
    private String laboratoryName;

    /**
     * 设备类型
     */
    @NotBlank(groups = { AddGroup.class, EditGroup.class }, message = "设备类型不可为空")
    @Length(groups = { AddGroup.class, EditGroup.class }, max = 20, message = "设备类型不可超过{max}")
    private String type;

    /**
     * 设备名称
     */
    @NotBlank(groups = { AddGroup.class, EditGroup.class }, message = "设备名称不可为空")
    @Length(groups = { AddGroup.class, EditGroup.class }, max = 20, message = "设备名称不可超过{max}")
    private String name;

    /**
     * 设备型号
     */
    @Length(groups = { AddGroup.class, EditGroup.class }, max = 20, message = "设备型号不可超过{max}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String model;

    /**
     * 设备编号
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String code;

    /**
     * 设备厂商
     */
    @Length(groups = { AddGroup.class, EditGroup.class }, max = 20, message = "设备厂商不可超过{max}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String manufacturer;

    /**
     * 服务电话
     */
    @Length(groups = { AddGroup.class, EditGroup.class }, max = 11, message = "服务电话格式错误")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String servicePhone;

    /**
     * 设备数量
     */
    private Integer num;

    /**
     * 备注
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @Length(groups = { AddGroup.class, EditGroup.class }, max = 200, message = "备注不可超过{max}")
    private String remark;

    /**
     * 添加人
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Long creator;

    /**
     * 添加时间
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updater;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

}
